package zgh.structure.agent.staticproxy;

import java.util.Objects;

/**
 * @author zhanggonghui
 * @create 2022-04-17 13:20
 * @describe 代理商去下单拿货（静态代理类)
 **/
public class TVProxy implements TVCompany{

    private TVCompany tvCompany;

    public TVProxy() {

    }

    @Override
    public TV produceTV() {
        System.out.println("电视代理获得订单。。。。 ");
        System.out.println("电视代理开始制作。。。。");
        if (Objects.isNull(tvCompany)) {
            System.out.println("机器代理查找工厂。。。。");
            tvCompany = new TVFactory();
        }
        return tvCompany.produceTV();
    }

}
